import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    redirect: '/index',
    children: [
      {path: '/advertising', component: () => import('../views/home/AdvertisingView')},
      {path: '/index', component: () => import('../views/home/IndexView')},
      {path: '/message', component: () => import('../views/home/MessageView')},
      {path: '/module', component: () => import('../views/home/ModuleView')},
      {path: '/navigation', component: () => import('../views/home/NavigationView')},
      {path: '/permission', component: () => import('../views/home/PermissionView')},
      {path: '/picture', component: () => import('../views/home/PictureView')},
      {path: '/products', component: () => import('../views/home/ProductsView')},
      {path: '/taboowords', component: () => import('../views/home/TabooWordsView')},
      {path: '/traffic', component: () => import('../views/home/TrafficView')},
    ]
  },
  {   path: '/', component: () => import('../views/login/LoginView')},
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
